Skip to content

Conversation

kmcallister
Copy link
Contributor

This fixes two separate issues related to character encoding.

  • Add encode_utf16 to the Char trait, analogous to encode_utf8. &str already supports UTF-16 encoding but only with a heap allocation. Also fix encode_utf8 docs and add tests.
  • Correctly decode non-BMP hex escapes in JSON (json cannot decode non-BMP character escapes #13064).

bors added a commit that referenced this pull request Apr 13, 2014
This fixes two separate issues related to character encoding.

* Add `encode_utf16` to the `Char` trait, analogous to `encode_utf8`.  `&str` already supports UTF-16 encoding but only with a heap allocation.  Also fix `encode_utf8` docs and add tests.

* Correctly decode non-BMP hex escapes in JSON (#13064).
@bors bors closed this Apr 13, 2014
@bors bors merged commit cee9a83 into rust-lang:master Apr 13, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 3, 2024
Convert `&Option<T>` to `Option<&T>`

Run `ref_option` (rust-lang#13336) on the Clippy's own code, quiet a few hits. Per mentioned video, this may actually improve performance as well.  Switch lint to `pedantic`

----

changelog: [`ref_option`]: upgrade lint to `pedantic`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants